﻿//------------------------------------------------------------------
// System Name:    NRemedy
// Component:      NRemedy
// Create by:      Parker Zhou (parkerz@wicresoft.com)
// Create Date:    2012-04-10
//------------------------------------------------------------------
using BMC.ARSystem;
using System;
using System.Collections;

namespace NRemedy
{
    public interface IARServer : IDisposable
    {
        string Server { get; }
        string User { get;}
        string Password { get; }
        string Authentication { get; }

        Server BMCServer { get; }

        void SetContextContainer(ARLoginContext context);

        void Login(string server, string user, string password, string authentication);
        void ReLogin();
        bool ServerAlive { get; }
        bool IsInPool { get;}
        void Logout();
        ArrayList GetListForm();
        ARForm GetForm(string name);
        ArrayList GetListField(string formName);
        Field GetField(string formName, uint id);
        Hashtable GetAllFields(string form);

        void BeginBulkEntryTransaction();
        ArrayList CancelBulkEntryTransaction();
        ArrayList SendBulkEntryTransaction();

        string CreateEntry(string form, FieldValueList fieldValueList);
        void DeleteEntry(string form, string entryId, int deleteOption = 0);
        void SetEntry(string form, string entryId, FieldValueList fieldValueList);
        void SetEntryByQuery(string formName, string qualification, BMC.ARSystem.Server.SetEntryByQuery_NoMatchOption noMatchOption,
            BMC.ARSystem.Server.SetEntryByQuery_MultiMatchOption multiMatchOption, FieldValueList fieldValueList, bool useLocale = false);
        FieldValueList GetEntry(string form, string entryId, FieldIdList fieldIdList);
        ArrayList GetListEntry(string formName, string qualification, FieldIdList fieldIdList = null);

    }
}
